<div class="deal">
	<div class="deal_content_top"></div>
	<div class="deal_content">
		<h3><?php echo $this->deal->deal_title ?></h3>
		<div class="deal-left">
			<?php if($this->deal->deadline > date('Y-m-d g:i:s')): ?>
					<div class="price"><?php echo number_format($this->deal->price, 0, ".", ",") . 'đ' ?></div>
					<form action="<?php echo $this->baseUrl('index.php/checkout/cart/add/id/'.$this->deal->deal_id) ?>" method="POST">
						<input type="submit" class="buttonPrice" value=""/>
					</form>
				<?php else: ?>
					<div class="price"><?php echo number_format($this->deal->price, 0, ".", ",") . 'đ' ?></div>
					<input type="button" class="buttonPrice2" value="" onclick="alert('Đã hết hạn mua')"/>
				<?php endif; ?>			
			<div class="deal-block2"><span class="strongText">Giá gốc :&nbsp;</span><span class="strongPrice"><?php echo number_format($this->deal->value, 0, ".", ",") . 'đ' ?></span></div>
			<div class="deal-block2"><span class="strongText">Tiết kiệm :&nbsp;</span><span class="strongPrice"><?php echo number_format((floatval($this->deal->value) - floatval($this->deal->product_price)), 0, ".", ",") . 'đ' ?></span></div>
			<div class="deal-block2">
				<span class="strongText">Ngày hết hạn</span><span class="time"><?php echo date('d/m/Y', strtotime($this->deal->deadline)) ?></span>
			</div>
			<div class="deal-block2">
                                <?php if($this->report->deal_left <= 0): ?>
				Có <?php echo $this->report->count ?> người mua
				<br />Đã đạt được Giá tốt!
                                <?php else: ?>
                                Còn <?php echo $this->report->deal_left ?> phiếu để
                                <br />Đạt được giá tốt!
                                <?php endif ?>
				<?php if($this->report->count > 0): ?>
                                <h4 style="margin:5px 0;">Danh sách người mua</h4>
                                <ul style="padding-left:3px;margin:0;" id="deal_<?php echo $this->deal->deal_id?>">
                                    <?php foreach($this->report->users as $user): ?>
                                        <li><img src="<?php echo $this->baseUrl('public/images/user.png')?>" style="margin: 0 5px;" alt=""/><?php echo $user->fullname ?></li>
                                    <?php endforeach ?>
                                </ul>
                                <a href="#" onclick="loadUser(<?php echo $this->deal->deal_id ?>);return false;">Xem thêm >></a>
                                <?php endif ?>
			</div>
		</div>
		<div class="deal-right">
			<div class="deal-image">
				<div class="saleOff">
					<span class="price off">
						<?php
						$percent = (1 - ($this->deal->product_price / $this->deal->value))*100;
						echo number_format($percent, 0, ".", ","). '%';
						?>
					</span>
				</div>
				<img src="<?php echo $this->baseUrl('public/upload/images/deals/' . $this->deal->deal_avatar)?>" class="deal-right-img" alt="HopMua.com" />
				<div class="deal-right-comment"><a href="<?php echo $this->baseUrl('index.php/cms/index/deal/id/') . $this->deal->deal_id ?>">Xem chi tiết</a></div>
			</div>					
			<div class="deal-right-content"><?php echo $this->deal->deal_intro ?></div>
			<div class="deal-right-company" style="overflow:hidden;padding: 10px 0px;clear:both;">					
				<span>
					<a href="<?php echo $this->deal->supplier_url ?>" style="text-decoration:none;font-weight:bold;color:#235b96;"><?php echo $this->deal->supplier_name ?></a> - <?php echo $this->deal->supplier_contact ?> 
				</span>
			</div>
			
				<?php
				$link = (@$_SERVER["HTTPS"] == "on") ? "https://" : "http://";
				$link .= $_SERVER["SERVER_NAME"] . $this->baseUrl('index.php/cms/index/deal/id/'.$this->deal->deal_id);
				?>
			
			<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo $link ?>&amp;layout=standard&amp;show_faces=true&amp;width=450&amp;action=like&amp;font&amp;colorscheme=light&amp;height=80" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:80px;" allowTransparency="true"></iframe>					
		</div>
	</div>
	<div class="deal_content_bottom"></div>
</div>

<div class="deal">
	<div class="deal_content_top"></div>
	<div class="deal_content">
		<h3>Thông tin lưu ý</h3>
		<div>
			<?php echo $this->deal->deal_notes ?>
		</div>
	</div>
	<div class="deal_content_bottom"></div>
</div>

<div class="deal">
	<div class="deal_content_top"></div>
	<div class="deal_content">
		<h3>Nội dung chi tiết</h3>
		<div>
			<?php echo $this->deal->deal_fulltext ?>
		</div>
	</div>
	<div class="deal_content_bottom"></div>
</div>